home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------
- -- Created By: Kirill
- -- Description: This is the combat behaviour of the hellicopter gunner
- --------------------------
- -- Modyfied By:
-
- AIBehaviour.Gunner = {
- Name = "Gunner",
-
- -- SYSTEM EVENTS -----
- ---------------------------------------------
- OnSelected = function( self, entity )
-
- end,
- ---------------------------------------------
- OnSpawn = function( self, entity )
- -- called when enemy spawned or reset
- entity.cnt.AnimationSystemEnabled = 1;
- end,
- ---------------------------------------------
- OnActivate = function( self, entity )
- -- called when enemy receives an activate event (from a trigger, for example)
- end,
- ---------------------------------------------
- OnNoTarget = function( self, entity )
- -- called when the enemy stops having an attention target
- entity:SelectPipe(0,"h_gunner_no_fire");
- end,
- ---------------------------------------------
- OnPlayerSeen = function( self, entity, fDistance )
- -- called when the enemy sees a living player
- --AI:Signal(SIGNALID_READIBILITY, 1, "ENEMY_TARGET_REGAIN",entity.id);
-
- entity:SelectPipe(0,"h_gunner_fire");
- -- if (self.Status == "choose") then
- -- if (fDistance>10) then
- -- entity:SelectPipe(0,"cover_pindown");
- -- else
- -- entity:SelectPipe(0,"cover_scramble");
- -- end
- -- end
- end,
- ---------------------------------------------
- OnGrenadeSeen = function( self, entity, fDistance )
- -- InsertSubpipe
- System:LogToConsole( "Gunner sees the grenade -------------------------------------------------------------" );
- entity:SelectPipe(0,"h_gunner_ignore");
- end,
- ---------------------------------------------
- OnEnemySeen = function( self, entity )
- -- called when the enemy sees a foe which is not a living player
- end,
- ---------------------------------------------
- OnFriendSeen = function( self, entity )
- -- called when the enemy sees a friendly target
- end,
- ---------------------------------------------
- OnDeadBodySeen = function( self, entity )
- -- called when the enemy a dead body
- end,
- ---------------------------------------------
- OnEnemyMemory = function( self, entity )
- -- called when the enemy can no longer see its foe, but remembers where it saw it last
-
- end,
- ---------------------------------------------
- OnInterestingSoundHeard = function( self, entity )
- -- called when the enemy hears an interesting sound
- end,
- ---------------------------------------------
- OnThreateningSoundHeard = function( self, entity )
- -- called when the enemy hears a scary sound
- end,
- ---------------------------------------------
- ---------------------------------------------
- OnGroupMemberDied = function( self, entity )
- -- called when a member of the group dies
- end,
- ---------------------------------------------
- --------------------------------------------------
- ---------------------------------------------
- ---------------------------------------------
- OnReceivingDamage = function ( self, entity, sender)
- -- called when the enemy is damaged
- end,
- ---------------------------------------------
- OnCoverRequested = function ( self, entity, sender)
- -- called when the enemy is damaged
- end,
- --------------------------------------------------
- OnBulletRain = function ( self, entity, sender)
- -- called when the enemy detects bullet trails around him
- end,
- --------------------------------------------------
- OnDeath = function ( self, entity, sender)
- entity.cnt.AnimationSystemEnabled = 1;
- System:LogToConsole("GroupCount: "..AI:GetGroupCount(entity.Properties.groupid));
- if (AI:GetGroupCount(entity.Properties.groupid)== 2) and (entity.Properties.ReinforcePoint ~= "none") then
- AI:Signal(SIGNALFILTER_NEARESTGROUP, 1, "GoForReinforcement",entity.id);
- else
- AI:Signal(SIGNALFILTER_NEARESTGROUP, 1, "OnGroupMemberDiedNearest",entity.id);
- AI:Signal(SIGNALFILTER_GROUPONLY, 1, "OnGroupMemberDiedA",entity.id);
- end
- end,
- --------------------------------------------------
- --------------------------------------------------
- --------------------------------------------------
- --------------------------------------------------
- ---------------------------------------------
- ---------------------------------------------
- ------------------------------------------------------------------------
- }